class Lab < Location
  
  def process(message)
    case message
    when LabRequest
      deal_with_test(message)
    when TestComplete
      send_to_clinic(message)
      send_to_hrc(message)
    else
      super
    end
  end  
  
  def deal_with_test(message)
    @blocked = true
    # needs to take between 1 and 5 minutes to process test
    future_message(TestComplete.new(message),service_time(5))
  end
  
  def send_to_clinic(message)
    MedSim.send('clinic',LabResults.new(message))
  end
  
  def send_to_hrc(message)
    MedSim.send('hrc',LabResults.new(message))
  end
  
end